import 'package:flutter/material.dart';
import 'package:flutter2/colors.dart';
import 'package:flutter2/widget/base/base_container.dart';
import 'package:flutter2/widget/base/normal_text.dart';

class ItemPeriod extends StatelessWidget {
  const ItemPeriod({super.key, required this.select, this.click, this.text});

  final bool select;
  final VoidCallback? click;
  final String? text;

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: click,
      child: BaseContainer(
        strokeWidth: 1.5,
        alignment: Alignment.center,
        width: null,
        radius: 10,
        strokeColor: select ? btnColor : Colors.transparent,
        background: select ? tipColor : tipColorDark,
        child: NormalText(
          text: text,
          fontColor: select ? btnColor : mainText,
          fontSize: 14,
          fontWeight: FontWeight.bold,
        ),
      ),
    );
  }
}
